package com.zh.note.huawei.onehundred.绘图机器;

/**
 * @Author: zhanghuan
 * @date: 2023/8/31 20:25
 * @description: create it
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        try (Scanner s = new Scanner(System.in)) {
            int n = s.nextInt();
            int e = s.nextInt();
            int[][] ints = new int[n][2];
            for (int i = 0; i < n; ++i) {
                ints[i][0] = s.nextInt();
                ints[i][1] = s.nextInt();
            }
            solveMethod(n, e, ints);
        }
    }

    private static void solveMethod(int n, int e, int[][] ints) {
        Arrays.sort(ints, Comparator.comparingInt(a -> a[0]));
        // Arrays.sort(ints, (o1, o2) -> o1[0] - o2[0]);
        int curX = 0;
        int curY = 0;
        int area = 0;
        for (int i = 0; i < n; ++i) {
            int x = ints[i][0];
            int y = ints[i][1];
            area += (x - curX) * Math.abs(curY);
            curX = x;
            curY += y;
        }
        if (curX < e) {
            area += (e - curX) * Math.abs(curY);
        }
        System.out.print(area);
    }

}

